#ifndef DIALOG_CONFIGWORKGROUPPARAS_H
#define DIALOG_CONFIGWORKGROUPPARAS_H

#include <QDialog>
#include <QSettings>
#include "inimanager.h"
#include "dialog_newaddgroup.h"
#include "LineEditProductClass.h"

namespace Ui {
class Dialog_configWorkGroupParas;
}

class Dialog_configWorkGroupParas : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_configWorkGroupParas(QWidget *parent = nullptr);
    ~Dialog_configWorkGroupParas();
    bool savePara();
    void loatPara();
    void initData();
    void setGroupId_To_size_type(QString str);
public slots:
//    void do_addNewGroup(const QString &size);
    void do_addNewGroup(const uint16_t l, const uint16_t w, const uint16_t h);
    void do_setCurrentGroupShow(const QString &group);
    void do_setTopCameraFoucs(int val);
    void do_setTopCameraLightValue(int val);
    void do_setSideCameraFoucsA(int val);
    //    void do_setSideCameraFillLight(int val);
    void do_setCurrentGroupBrowse(const QString &group);
    void do_LWH_To_currGroupId();
    void do_setSideCameraLightA(int val);
    void do_setSideFillLightA(int val);
    void on_btn_getSideCameraFoucsB_clicked();
    void do_setSideCameraFoucsB(int val);
    void do_setSideCameraLightB(int val);
    void do_setSideFillLightB(int val);
    void do_setSideCameraFoucsC(int val);
    void do_setSideCameraLightC(int val);
    void do_setSideFillLightC(int val);
    void do_setSideCameraFoucsD(int val);
    void do_setSideCameraLightD(int val);
    void do_setSideFillLightD(int val);
    void do_setBottomCameraLightValue(int val);

    void do_getProductClassNewGroup(QString productClass);
signals:
    // 光源
    void sendTopRoSideLightData(QString dat);
    void sendBottomLightData(QString dat);

    void getTopLightRecv(const QString dat);
    void getBottomLightRecv(const QString dat);
    // 镜头
    void sendTopAdjustData(QByteArray dat);
    void sendSideAdjustData(QByteArray dat);

    void getTopAdjustRecv(const QByteArray dat);
    void getSideAdjustRecv(const QByteArray dat);

    void currentWorkGroupData(const QMap<QString, QString> WorkGroupData);


private slots:

    void on_btn_save_clicked();

    void on_btn_cancel_clicked();

    void on_btn_next_clicked();

    void on_btn_pre_clicked();

    void on_btn_addNewGroup_clicked();

    void on_btn_getTopCameraFoucs_clicked();

    void on_btn_getTopCameraLightValue_clicked();

    void on_btn_getSideCameraFoucsA_clicked();

//    void on_btn_getSideCameraFillLight_clicked();

    void on_comboBox_workGroupId_currentTextChanged(const QString &arg1);

    void on_btn_toSave_clicked();

    void on_btn_exit_clicked();

    void on_btn_getSideCameraLightA_clicked();

    void on_btn_getSideFillLightA_clicked();

    void on_btn_getSideCameraLightB_clicked();

    void on_btn_getSideFillLightB_clicked();

    void on_btn_getSideCameraFoucsC_clicked();

    void on_btn_getSideCameraLightC_clicked();

    void on_btn_getSideFillLightC_clicked();

    void on_btn_getSideCameraFoucsD_clicked();

    void on_btn_getSideCameraLightD_clicked();

    void on_btn_getSideFillLightD_clicked();

    void on_btn_getBottomCameraLightValue_clicked();

    void on_stackedWidget_currentChanged(int arg1);

    void waitForTime(int finishTime, int intervalTime=1000);
    QByteArray intToByteArray(int value);
    QByteArray formSetAngleData(int angle);
//    QByteArray formSetAngleData(int16_t angle);

//    void on_comboBox_chainWidth_set_activated(const QString &arg1);

    void do_initTopFocus(int angle);
    void do_initSideFocus(int angle);
private:
    Ui::Dialog_configWorkGroupParas *ui;
    int currentGroupIndex;
    QStringList groups;
    int maxGroupIndex;
    QSettings *settings = nullptr;
    QString currentGroup;

    uint16_t m_L;
    uint16_t m_W;
    uint16_t m_H;

    QString m_Id_set;
    QString m_L_set;
    QString m_W_set;
    QString m_H_set;

    bool m_newGroupFlag = false;

    iniManager *m_iniManager = nullptr;

    QStringList m_newGroup;
};

#endif // DIALOG_CONFIGWORKGROUPPARAS_H
